<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['系统基础管理','挂车管理']" icon="fa fa-list" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header>
					<span class="widget-icon"><i class="fa fa-table"></i></span>
					<h2>挂车管理</h2>
				</header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn">
								<div class="top_module top_module_box">
									<span class="module_text">关联车头</span>
									<div class="s_hover_box">
										<select class="select2" id="carNumberSelect">
											<option value=''></option>
										</select>
										<div class="s_del_icon" (click)='del_carNumber()'>x</div>
									</div>
								</div>
								<div class="top_module top_module_box">
									<span class="module_text">挂车牌号</span>
									<div class="s_hover_box">
										<select class="select2" id="carNumberSelect2">
											<option value=''></option>
										</select>
										<div class="s_del_icon" (click)='del_carNumber2()'>x</div>
									</div>
								</div>
								<div class="top_module top_module_box" >
									<span class="top_module_label module_text">车辆类型</span>
									<select class="top_module_select select2" select2 id="TcarTypeSelect2">
										<option value="">全部</option>
										<optgroup *ngFor="let item of carTypeList" [label]="item.label">
											<option *ngFor="let lis of item.children" [value]='lis.id'>{{lis.label}}</option>
										</optgroup>
									</select>
								</div>
								<button type="button" class="btn btn-primary" (click)="tableSearch()">查询</button>
								<button type="button" class="btn btn-primary" (click)="addRecordDetail(recordDetailModal)">添加</button>
								<button type="button" class="btn btn-primary" (click)="openSyncCarModal(syncCarModal)">同步</button>
							</div>
							<div class="right top-search">
								<input type="text" [(ngModel)]="searchKey" (change)="tableSearch()" class="search-input" placeholder="挂车牌号/关联车头/录入人员">
								<span class="top-search-box">
									<button class="top-search-btn" type="button" (click)="tableSearch()"> <i class="fa fa-search"></i></button>
								</span>
							</div>
						</div>
						<div class="table_scroll">
							<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<th>操作</th>
										<th>挂车牌号</th>
										<th>关联车头</th>
										<th>车辆类型</th>
										<th>创建时间</th>
										<th>录入人员</th>
										<th>更新时间</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of tableData">
										<td>
											<button type="button" (click)="edtrRecord(row,recordDetailModal)">编辑</button>
											<button *ngIf="row.trailerCarImg!=''" type="button" (click)="showImg2(row,imgModal2)">查看</button>
											<button type="button" (click)="deleteRecord(row)">删除</button>
										</td>
										<td>{{row.trailerCarNumber}}</td>
										<td>{{row.headstockNumber}}</td>
										<td>{{row.useTypeLKey}}</td>
										<td>{{row.createTime}}</td>
										<td>{{row.createName}}</td>
										<td>{{row.updateTime}}</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator [totalRecords]="totalCounts" [rows]="pageSize" [currentPage]="curPage - 1" (onPageChange)="paginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</sa-widgets-grid>
</div>
<!-- 图片查看   弹窗-->
<section bsModal #imgModal2="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
	<div class="modal-dialog modal-lg">
		<div class="modal-content" style="width: 570px;">
			<div class="modal-header">
				<button type="button" class="close" (click)="closeImgModal2(imgModal2)" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<h4 class="modal-title">图片</h4>
			</div>
			<div class="modal-body">
				<div class="imagesInfo2">
					<div class="imgShow" *ngFor="let item of imgLocalList" (click)="bigimg('Modal2',item)">
						<img [src]="item" alt="挂车照片" style="cursor: pointer;" />
					</div>
				</div>
			</div>
		</div>
	</div>
</section>
<!-- 图片查看 弹窗end-->


<!--    弹窗 新增-->
<section bsModal #recordDetailModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
	<div class="modal-dialog modal-lg" style="width: 600px;">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" (click)="recordDetailClose(recordDetailModal)" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<h4 class="modal-title">{{pageType}}挂车管理</h4>
			</div>
			<form id="recordDetailForm" class="form-horizontal" role="form" novalidate="novalidate" [saBootstrapValidator]="syncrecordDetailOptions">
				<div class="modal-body" style="min-height: 240px;max-height: 560px;">
					<div class="row form-horizontal">
						<div class="form-group col-sm-12">
							<div class="col-sm-12 col-xs-12">
								<label class="control-label col-xs-3 no-padding-right" style="padding: 7px 0 0;">挂车牌号<sup>*</sup></label>
								<div class="col-xs-9">
									<input class="form-control" type="text" [(ngModel)]='recordDetailFrom.trailerCarNumber' name='trailerCarNumber' placeholder="挂车牌号" />
								</div>
							</div>
						</div>
						<div class="form-group col-sm-12">
							<div class="col-sm-12 col-xs-12">
								<label class="control-label col-xs-3 no-padding-right" style="padding: 7px 0 0;">车辆类型<sup>*</sup></label>
								<div class="col-xs-9">
									<select class="top_module_select select2"  name="carUseType" (change)="carUseTypeL1Change()"  style="width: 100%;height: 34px;line-height: 34px;border-color: #ccc;" [(ngModel)]='recordDetailFrom.useTypeL2'>
										<optgroup *ngFor="let item of carTypeList" [label]="item.label" >
											<option *ngFor="let lis of item.children" [value]='lis.id'>{{lis.label}}</option>
										</optgroup>
									</select>
								</div>
							</div>
						</div>
						<div class="form-group col-sm-12">
							<div class="col-sm-12 col-xs-12">
								<label class="control-label col-xs-3 no-padding-right" style="padding: 7px 0 0;">关联车头</label>
								<div class="col-xs-9 s_fix_select2_width s_fix_select2">
									<sa-select2 select2ElementID="trailerManageSelect2" (optionSelected)="optionSelected($event)" matchSearch="true"></sa-select2>
								</div>
							</div>
						</div>
						<div class="form-group col-sm-12" style="margin-bottom: 0px;">
							<div class="col-sm-12 col-xs-12">
								<label class="control-label col-xs-3 no-padding-right" style="padding: 7px 0 0;">挂车牌号照片<sup>*</sup></label>
								<div class="col-xs-9 imgFileList">
									<div class="imgFileList-power">
										<div class="imgFileList-multifile">
											<div class="uploadlocation uploadlocation1">
												<div class="content-list">
													<div class="headImg" *ngFor="let item of imageInfoList; let i = index">
														<div class="contentImg"><img class="img" [src]="item" (click)="bigImgClick(item)" style="width: 100%;"></div>
														<i class="deleteImg" (click)="deleteImg(i)"></i>
													</div>
													<div class="btn div_imgall" *ngIf="imageInfoList.length == 0">
														<div class="div_shuline"></div>
														<div class="div_hengline"></div>
														<input type="file" class="up" title=" " placeholder=" " accept="image/*" (change)="multifileChange($event.target.files)"/>
													</div>
												</div>
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</form>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" (click)="recordDetailClose(recordDetailModal)">取消</button>
				<button type="button" class="btn btn-primary" (click)="recordDetailSubmit(recordDetailModal)">确认</button>
			</div>
		</div>
	</div>
</section>
<!--  弹窗end-->
<!-- 设置同步项目车辆  弹窗-->
<section bsModal #syncCarModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
	<div class="modal-dialog modal-lg">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" (click)="syncCarClose(syncCarModal)" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<h4 class="modal-title">同步</h4>
			</div>
			<form id="syncCarFrom" class="form-horizontal" role="form" novalidate="novalidate" [saBootstrapValidator]="syncCarvalidatorOptions">
				<div class="modal-body">
					<div class="row form-horizontal">
						<div class="form-group col-xs-12" style="margin-bottom: 0px;">
							<label class="control-label col-sm-2 no-padding-right">选择平台<sup>*</sup></label>
							<div class="col-xs-10">
								<select name="syncCompany" class="form-control" [(ngModel)]="sourceType" style="width:100%">
									<option value="">请选择</option>
									<option value="1">物流信息系统</option>
								</select>
							</div>
						</div>
					</div>
				</div>
			</form>
			<div style="margin-left: 25px;padding-bottom: 10px;text-align: left;font-size: 12px;color: #8a8a8a;">
				<p>同步说明：</p>
				<p>1、只会同步对应平台的关联关系，并更新挂车牌号关联的车头车牌号。</p>
				<p>2、不会将所选平台的挂车信息同步新增过来。</p>
			</div>
			<div class="modal-footer" style="position: relative;">
				<button type="button" class="btn btn-default" (click)="syncCarClose(syncCarModal)">取消</button>
				<button type="button" class="btn btn-primary" (click)="submitSyncCar(syncCarModal)">确认</button>
			</div>
		</div>
	</div>
</section>
<!-- 设置同步项目车辆 End-->